<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@ page import="org.hibernate.cfg.Configuration" %>
    <%@ page import="org.hibernate.tool.hbm2ddl.SchemaExport" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
<%
    //读取配置文件 
    Configuration cfg = new Configuration().configure(); 
     
    //创建SchemaExport对象 
    SchemaExport export = new SchemaExport(cfg); 
     
    //创建数据库表 
    export.create(true,true); 
%>
</body>
</html>